#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <math.h>

#include <json/json.h>

#include "debug.h"

#include "mmm.h"

typedef struct db_db
{
	char *db_file;
	struct json_object *jo;
} db_db;

typedef struct db_user
{
	char *name;
	char *password;
	char *seed;
} db_user;

void print_hex( uint8_t *d, int l, int s );
char *new_string( const char *str );

db_db* open_json_db( const char * );
int close_json_db( db_db* );
int check_user( char* );
int get_user( db_db*, const char*, db_user** );
int add_user( db_db*, const char*, const char*, const char* );
int add_user_pass();
int update_user_pass(  );
int del_user_pass();
int del_user( char* );
int clean_user( db_user* );

